// https://leetcode.cn/problems/hamming-distance
class Solution {
public:
    int hammingDistance(int x, int y) {
        // 异或后统计1的位数即可
        int tmp = x ^ y; 
        int count = 0;
        while(tmp) {
            tmp &= (tmp - 1);
            count++;
        }
        return count;
    }
};
